﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

using VuzixSample.model;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

/*
 *  basic scene for proof of concept
 * 
 */

namespace VuzixSample.controller
{
    class Demo : IScene
    {
        //Effect simpleColorEffect;
        Matrix _world;
        Cube cube;
        
        public void Initialise(GraphicsDeviceManager graphics)
        {
            _world = Matrix.Identity;

            cube = new Cube();
            cube.Initialise(20, graphics);
        }
        public void Render(GraphicsDevice usingContext, Camera camera, Effect shader)
        {

            //-------------------------------------------------------------------------
            //draw your scene here...
            //------------------------------------------------------------------------

            //shader
            shader.Parameters["WVP"].SetValue(World * camera.View * camera.Projection);
            shader.CurrentTechnique.Passes[0].Apply();

            //geometry
            cube.Render(usingContext);
        }
        public void Update()
        {
            //spin the cube - this is the 1990's after all...
            _world *= Matrix.CreateRotationY(-0.01f);
        }
        public void Dispose()
        {
            cube.Dispose();
        }

        public Matrix World
        {
            get { return _world;  }
        }
    }
}
